<template>
  <el-card shadow="hover">
    <span class="btn" style="font-size: 20px;font-weight: bold" @click="this.$router.go(-1)">返回</span>
    <h1 style="text-align: center">{{Article.title}}</h1>
    <p style="text-align: center"><el-tag class="btn" @click="$router.push('/index/'+Article.kind)">{{Article.kind}}</el-tag></p>

    <v-md-preview :text="Article.text"></v-md-preview>
    <span style="float: right">阅读量:{{Article.readSum}}</span>
  </el-card>
</template>

<script>
import {articleById} from "@/api/article";

export default {
  name: "articleT",
  data(){
    return{
      Article:{}
    }
  },
  mounted() {
    let id=this.$route.params.id;
    articleById(id).then(res=>{
      let x=res.data;
      if(x.code==="100"){
        this.Article=x.data;
      }else this.$notify.error(this.notifyMsgErr(x.msg));
    }).catch(err=>this.$notify.error(this.notifyMsgErr(err.message)));
  }
}
</script>

<style scoped>
.el-card{
  border-radius: 15px;
}
</style>
